<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QSculpt: engine/include/Vertex.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QSculpt
   &#160;<span id="projectnumber">0.0.1a</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">engine/include/Vertex.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *  Vertex.h</span>
<a name="l00003"></a>00003 <span class="comment"> *  QSculpt</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> *  Created by Roberto Cabral on 12/18/09.</span>
<a name="l00006"></a>00006 <span class="comment"> *  Copyright 2009 __MyCompanyName__. All rights reserved.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> */</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef VERTEX_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define VERTEX_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;Eigen/Core&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;QAtomicInt&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;Point3D.h&quot;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;IIterator.h&quot;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="keyword">class </span><a class="code" href="class_edge.html">Edge</a>;
<a name="l00019"></a>00019 <span class="keyword">class </span><a class="code" href="class_face.html">Face</a>;
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="keyword">enum</span> VertexFlags {
<a name="l00022"></a>00022     VF_None     = 0,
<a name="l00023"></a>00023     VF_Selected = 0x00000001, <span class="comment">/*&lt; Vertex is selected*/</span>
<a name="l00024"></a>00024     VF_Deleted  = 0x00000002, <span class="comment">/*&lt; Vertex is marked as deleted.*/</span>
<a name="l00025"></a>00025     VF_Crease   = 0x00000004,
<a name="l00026"></a>00026     VF_User1    = 0x00100000, <span class="comment">/*&lt; Flag to use for the user */</span>
<a name="l00027"></a>00027     VF_User2    = 0x00200000, <span class="comment">/*&lt; Flag to use for the user */</span>
<a name="l00028"></a>00028     VF_ALL      = 0xFFFFFFFF
<a name="l00029"></a>00029 };
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="class_vertex.html">00031</a> <span class="keyword">class </span><a class="code" href="class_vertex.html">Vertex</a>
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033     <span class="keyword">static</span> QAtomicInt NEXT_ID;
<a name="l00034"></a>00034 
<a name="l00035"></a>00035     Point3        _position; <span class="comment">// 16</span>
<a name="l00036"></a>00036     Vector3       _normal;  <span class="comment">// 16</span>
<a name="l00037"></a>00037     Vector3       _color;   <span class="comment">// 16</span>
<a name="l00038"></a>00038     <span class="keywordtype">int</span>           _id;      <span class="comment">//4</span>
<a name="l00039"></a>00039     VertexFlags   _flags;   <span class="comment">// 4</span>
<a name="l00040"></a>00040     <a class="code" href="class_edge.html">Edge</a>        * _he;      <span class="comment">// 4</span>
<a name="l00041"></a>00041     <span class="keywordtype">void</span>        * _userData; <span class="comment">// 4</span>
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keyword">public</span>:
<a name="l00044"></a>00044 
<a name="l00048"></a>00048     <a class="code" href="class_vertex.html#a97488994a2482d70da74e1b91d40e169">Vertex</a>();
<a name="l00049"></a>00049 
<a name="l00053"></a>00053     <a class="code" href="class_vertex.html#a97488994a2482d70da74e1b91d40e169">Vertex</a>(<span class="keyword">const</span> Point3 &amp; position,
<a name="l00054"></a>00054            <span class="keyword">const</span> Vector3 &amp; <a class="code" href="class_vertex.html#ae9c6499e8d2d9b59da74a8445bca232e">normal</a> = Vector3(0, 1, 0),
<a name="l00055"></a>00055            <span class="keyword">const</span> Vector3 &amp; <a class="code" href="class_vertex.html#a30ecba0fb3c0ec2efb3bedbce1e82706">color</a> = Vector3(1, 1, 1)
<a name="l00056"></a>00056                                    );
<a name="l00057"></a>00057 
<a name="l00065"></a>00065     <a class="code" href="class_vertex.html#a97488994a2482d70da74e1b91d40e169">Vertex</a>(<span class="keyword">const</span> <a class="code" href="class_vertex.html">Vertex</a>&amp;);
<a name="l00066"></a>00066 
<a name="l00070"></a><a class="code" href="class_vertex.html#aabd55e4c54efa76b94a401edf9195c12">00070</a>     <span class="keywordtype">int</span> <a class="code" href="class_vertex.html#aabd55e4c54efa76b94a401edf9195c12">iid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _id; }
<a name="l00071"></a>00071 
<a name="l00075"></a><a class="code" href="class_vertex.html#aefc933c2d21b2429fb515d4afbb63eb0">00075</a>     Point3 <a class="code" href="class_vertex.html#aefc933c2d21b2429fb515d4afbb63eb0">getPosition</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _position; }
<a name="l00076"></a>00076     Point3 position()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _position; }
<a name="l00077"></a>00077     Point3&amp; position() { <span class="keywordflow">return</span> _position; }
<a name="l00078"></a>00078 
<a name="l00082"></a><a class="code" href="class_vertex.html#a30ecba0fb3c0ec2efb3bedbce1e82706">00082</a>     Vector3 <a class="code" href="class_vertex.html#a30ecba0fb3c0ec2efb3bedbce1e82706">color</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _color; }
<a name="l00083"></a>00083     Vector3&amp; <a class="code" href="class_vertex.html#a30ecba0fb3c0ec2efb3bedbce1e82706">color</a>() { <span class="keywordflow">return</span> _color; }
<a name="l00084"></a>00084 
<a name="l00088"></a><a class="code" href="class_vertex.html#ae9c6499e8d2d9b59da74a8445bca232e">00088</a>     Vector3 <a class="code" href="class_vertex.html#ae9c6499e8d2d9b59da74a8445bca232e">normal</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _normal; }
<a name="l00089"></a>00089     Vector3&amp; <a class="code" href="class_vertex.html#ae9c6499e8d2d9b59da74a8445bca232e">normal</a>() { <span class="keywordflow">return</span> _normal; }
<a name="l00090"></a>00090 
<a name="l00094"></a><a class="code" href="class_vertex.html#a3f1b2ad060705ff8ca2856ee4a3754d0">00094</a>     <span class="keywordtype">void</span> <a class="code" href="class_vertex.html#a3f1b2ad060705ff8ca2856ee4a3754d0">setEdge</a>(<a class="code" href="class_edge.html">Edge</a>* he) { _he = he; }
<a name="l00095"></a>00095     <a class="code" href="class_edge.html">Edge</a>* edge()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _he; }
<a name="l00096"></a>00096 
<a name="l00100"></a><a class="code" href="class_vertex.html#ae55f75309a2b7447ae6daf7bcb4be108">00100</a>     <span class="keywordtype">void</span> <a class="code" href="class_vertex.html#ae55f75309a2b7447ae6daf7bcb4be108">addFlag</a>(VertexFlags flag) { _flags = (VertexFlags)(_flags | flag); }
<a name="l00101"></a>00101     <span class="keywordtype">void</span> removeFlag(VertexFlags flag) { _flags = (VertexFlags)(_flags &amp; ~flag); }
<a name="l00102"></a>00102     VertexFlags flags()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _flags; }
<a name="l00103"></a>00103     <span class="keywordtype">bool</span> isFlagSet(VertexFlags flag) { <span class="keywordflow">return</span> (_flags &amp; flag) != 0;}
<a name="l00104"></a>00104 
<a name="l00108"></a><a class="code" href="class_vertex.html#a59e94a1d406bec8afaba5fa2fcd5d6a3">00108</a>     <span class="keywordtype">void</span> <a class="code" href="class_vertex.html#a59e94a1d406bec8afaba5fa2fcd5d6a3">setUserData</a>(<span class="keywordtype">void</span> * data) {
<a name="l00109"></a>00109         _userData = data;
<a name="l00110"></a>00110     }
<a name="l00111"></a>00111     
<a name="l00117"></a><a class="code" href="class_vertex.html#ad51f46d8994a5d6fecc9f2523c07b034">00117</a>     <span class="keywordtype">void</span> * <a class="code" href="class_vertex.html#ad51f46d8994a5d6fecc9f2523c07b034">userData</a>()<span class="keyword"> const </span>{
<a name="l00118"></a>00118         <span class="keywordflow">return</span> _userData;
<a name="l00119"></a>00119     }
<a name="l00120"></a>00120 
<a name="l00125"></a><a class="code" href="class_vertex.html#a0738fbd1425b5a3ac12aa594854b48b9">00125</a>     <a class="code" href="class_vertex.html#a0738fbd1425b5a3ac12aa594854b48b9">operator Point3</a>() { <span class="keywordflow">return</span> _position; };
<a name="l00126"></a>00126 
<a name="l00127"></a>00127     QString toString();
<a name="l00128"></a>00128 
<a name="l00129"></a>00129     <a class="code" href="class_vertex.html">Vertex</a> &amp; operator=(<span class="keyword">const</span> <a class="code" href="class_vertex.html">Vertex</a> &amp; v);
<a name="l00130"></a>00130 
<a name="l00134"></a>00134     <span class="keywordtype">bool</span> <a class="code" href="class_vertex.html#a7f1217525ed5dffeeebc7201d4827e7c">operator==</a>(<span class="keyword">const</span> <a class="code" href="class_vertex.html">Vertex</a>&amp; v) <span class="keyword">const</span>;
<a name="l00135"></a>00135 
<a name="l00139"></a>00139     <span class="keywordtype">bool</span> <a class="code" href="class_vertex.html#ae704d41fe2ff1316201b85c5ec2d7d5b">operator!=</a>(<span class="keyword">const</span> <a class="code" href="class_vertex.html">Vertex</a>&amp; v) <span class="keyword">const</span>;
<a name="l00140"></a>00140 
<a name="l00144"></a>00144     <a class="code" href="class_iterator.html">Iterator&lt;Vertex&gt;</a> vertexIterator();
<a name="l00145"></a>00145 
<a name="l00149"></a>00149     <a class="code" href="class_iterator.html">Iterator&lt;Face&gt;</a> <a class="code" href="class_vertex.html#a6bab979513650b8ac357742ebc51f460">faceIterator</a>();
<a name="l00150"></a>00150     
<a name="l00154"></a>00154     <a class="code" href="class_iterator.html">Iterator&lt;Edge&gt;</a> <a class="code" href="class_vertex.html#aa13d539657fd05916d6fc312c30b5249">edgeIterator</a>();
<a name="l00155"></a>00155     
<a name="l00156"></a>00156 <span class="keyword">private</span>:
<a name="l00157"></a>00157     <span class="keyword">class </span>VertexIterator;
<a name="l00158"></a>00158     <span class="keyword">class </span>FaceIterator;
<a name="l00159"></a>00159     <span class="keyword">class </span>EdgeIterator;
<a name="l00160"></a>00160     
<a name="l00161"></a>00161     <span class="keyword">friend</span> <span class="keyword">class </span>VertexIterator;
<a name="l00162"></a>00162     <span class="keyword">friend</span> <span class="keyword">class </span>FaceIterator;
<a name="l00163"></a>00163     <span class="keyword">friend</span> <span class="keyword">class </span>EdgeIterator;
<a name="l00164"></a>00164 };
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 27 2011 15:38:52 for QSculpt by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
